package com.syp.auth.dao.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.syp.auth.dao.po.AppEntity;

@Repository
public interface AppRepository extends JpaRepository<AppEntity, Long>, JpaSpecificationExecutor<AppEntity> {

	/**
	 * 根据应用编码获取应用
	 * 
	 * @param appCode
	 * @return
	 */
	public AppEntity getByAppCode(@Param("appCode") String appCode);

	/**
	 * 批量删除应用
	 * 
	 * @param ids
	 * @return
	 */
	@Query("DELETE AppEntity WHERE id in(:idList)")
	@Modifying
	public Integer deleteBatch(@Param("idList") List<Long> idList);
}
